﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using Toyger.Common.PlugIn;
using Toyger.Common.Connections;

namespace Toyger.UI
{
    public partial class Serverpage : UserControl
    {
        #region variables
        ConnectionSession session = null;
        #endregion
        public Serverpage(ConnectionSession session)
        {
            this.session = session;
            InitializeComponent();
            this.Dock = DockStyle.Fill;
            tp = new TabPage(session.Title);
            tp.Controls.Add(this);
            tp.Disposed += new EventHandler(tp_Disposed);
        }

        void tp_Disposed(object sender, EventArgs e)
        {
            Close();
        }

        private void Close()
        {
        	Debug.WriteLine(String.Format("{0} is closed",this.session.Title),"Close");
        }

        #region TabPage
        TabPage tp;
        internal TabPage TabPage
        {
            get
            {
                return tp;
            }
        }
        #endregion
    }
}
